const dotenv = require('dotenv')
const path = require('path')

dotenv.config({
  path: path.resolve(__dirname, '../../.env')
})

module.exports = {
  port: process.env.PORT || 4000,
  env: process.env.NODE_ENV,
  dbconfig: {
    connectionLimit: +process.env.DB_CONNECT_LIMIT || 10,
    host: process.env.DB_HOST || '127.0.0.1',
    port: process.env.DB_PORT || 3306,
    user: process.env.DB_USER || 'root',
    password: process.env.DB_PASS || '123456',
    database: process.env.DB_NAME || 'test',
    charset: process.env.DB_CHARSET || 'utf8mb4_general_ci',
    wait_timeout: 20000
  },
  github: {
    clientId: process.env.GITHUB_CLIENT_ID,
    clientSecret: process.env.GITHUB_CLIENT_SECRET,
    callbackUrl: process.env.GITHUB_CALLBACK_URL
  },
  email: {
    host: process.env.EM_EMAIL || 'smtp.163.com',
    secure: true,
    port: process.env.EM_PORT || 465,
    auth: {
      user: process.env.EM_USER,
      pass: process.env.EM_PASS
    }
  },
  runNotifyEmails: [
    'lanyueos@qq.com'
  ]
}
